import {
    request
} from '../utils/request';

export async function fetchDeviceInfo(params) {
    return request({
        url: '/deviceBase/getDeviceBase_details',
        method: 'POST',
        data: {
            ...params
        },
    })
}

export async function fetchPressureList(params) {
    return request({
        url: '/deviceBase/getDeviceBase_bloodPressure',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchSugarList(params) {
    return request({
        url: '/deviceBase/getDeviceBase_bloodSugar',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchUpdatePressure(params) {
    return request({
        url: '/deviceBase/upodate_userTag',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchUpdateSugar(params) {
    return request({
        url: '/deviceBase/upodate_bloodSugar',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchDeviceTrajectory(params) {
    return request({
        url: '/deviceBase/trajectory',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchUpdateName(params) {
    return request({
        url: '/deviceBase/update_name',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchUnpairDevice(params) {
    return request({
        url: '/deviceBase/deleteMatching',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchDeviceList(params) {
    return request({
        url: '/deviceBase/getDeviceBaseByid',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchDeviceContacts(params) {
    return request({
        url: '/deviceBase/contactInfo_details',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchDeviceBind(params) {
    return request({
        url: '/deviceBase/bind',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchDeviceUpdate(params) {
    return request({
        url: '/deviceBase/edit',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchSugarDetail(params) {
    return request({
        url: '/deviceBase/getDeviceBase_bloodSugar_unscramble',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchPressureDetail(params) {
    return request({
        url: '/deviceBase/getDeviceBase_bloodPressure_unscramble',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchExistenceHistory(params) {
    return request({
        url: '/deviceBase/getHumanExistenceInfoHistory',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchTyfallHistory(params) {
    return request({
        url: '/deviceBase/getTianyuRadarDeviceInfoHistory',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchRemoveBind(params) {
    return request({
        url: '/deviceBase/removeBind',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchSleepData(params) {
    return request({
        url: '/deviceBase/getTianyuSleepInfoHeartRate',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchSleepHistory(params) {
    return request({
        url: '/deviceBase/getTianyuSleepInfoHistory',
        method: 'POST',
        data: {
            ...params
        }
    })
}